package LeetCode刷题;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-10-31 16:10
 * @description: Functions of this class is
 * 官方题解：
 * public class Codec {
 *
 *     public String serialize(TreeNode root) {
 *         return serializeTree(root,new StringBuilder()).toString();
 *     }
 *     private StringBuilder serializeTree(TreeNode root,StringBuilder str){//这个String改成StringBuilder最好，会更快
 *         if(root==null){
 *             str.append("null,");
 *         }
 *         else{
 *             str.append(root.val+",");
 *             str=serializeTree(root.left,str);
 *             str=serializeTree(root.right,str);
 *         }
 *         return str;
 *     }
 *     public TreeNode deserialize(String data) {
 *         String dataArray[]=data.split(",");
 *         List<String> list=new ArrayList<String>(Arrays.asList(dataArray));
 *         return createdeserializeTree(list);
 *     }
 *     private TreeNode createdeserializeTree(List<String> list){
 *         if(list.get(0).equals("null")){
 *            list.remove(0);
 *             return null;
 *         }
 *         TreeNode root=new TreeNode(Integer.valueOf(list.get(0)));
 *         list.remove(0);
 *         root.left=createdeserializeTree(list);
 *         root.right=createdeserializeTree(list);
 *         return root;
 *     }
 * }
 **/
public class NoNo二叉树的序列化与反序列化 {
    public static void main(String args[]){

    }
}